package com.lysj.food.food.feignImpl;

import com.lysj.admin.common.food.feign.FoodServiceFeign;
import com.lysj.food.food.domain.Food;
import com.lysj.food.food.service.FoodService;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;


/**
 * @author Created by wtl on 2019-04-11 19:18
 * @description 菜品feign实现
 */
@RestController
public class FoodServiceFeignImpl implements FoodServiceFeign {


    @Resource
    private FoodService foodService;

    @Override
    public boolean foodAreaClean(String areaId) {
        List<Food> foodList = foodService.getRepository().findByAreaId(areaId);
        for (Food food : foodList) {
            food.setAreaId("");
        }
        foodService.save(foodList);
        return true;
    }
}
